<?php
namespace app\common\model;

use think\Model;

class admin_user extends Model
{
	 protected $table = 'admin_user';

    // 登录
    public function login($data)
    {
        if(empty($data['username'])){
            return false;
        }
        // var_dump($data);die;
        return $this->where($data)->find();
    }

    // 更新用户表
    public function upda($id,$update)
    {
        return $this->where('id',$id)->save($update);
    }


    public function name($username)
    {
     if(empty($username)){
         return false;
     }
     $where=[
         "username"=>trim($username),
    ];
        return $this->where($where)->find();
    }










}















 ?>